1. Field of the Invention
The present invention relates to a method, system, and program for managing a relationship between one target volume and one source volume,
2. Description of the Related Art
Computing systems often include one or more host computers (“hosts”) for processing data and running application programs, direct access storage devices (DASDs) for storing data, and a storage controller for controlling the transfer of data between the hosts and the DASD. Storage controllers, also referred to as control units or storage directors, manage access to a storage space comprised of numerous hard disk drives connected in a loop architecture, otherwise referred to as a Direct Access Storage Device (DASD). Hosts may communicate Input/Output (I/O) requests to the storage space through the storage controller.
In many systems, data on one storage device, such as a DASD, may be copied to the same or another storage device so that access to data volumes can be provided from two different devices. A point-in-time copy involves physically copying all the data from source volumes to target volumes so that the target volume has a copy of the data as of a point-in-time. A point-in-time copy can also be made by logically making a copy of the data and then only copying data over when necessary, in effect deferring the physical copying. This logical copy operation is performed to minimize the time during which the target and source volumes are inaccessible.
One such logical copy operation is known as FlashCopy® (FlashCopy is a registered trademark of International Business Machines, Corp. or “IBM”). FlashCopy® involves establishing a logical point-in-time relationship between source and target volumes on different devices. The FlashCopy function guarantees that until a track in a FlashCopy relationship has been hardened to its location on the target disk, the track resides on the source disk. A relationship table is used to maintain information on all existing FlashCopy relations in the subsystem. During the establish phase of a FlashCopy relationship, one entry is recorded in the source and target relationship tables for the source and target that participate in the FlashCopy being established. Each added entry maintains all the required information concerning the FlashCopy relation. Both entries for the relationship are removed from the relationship tables when all FlashCopy tracks from the source extent have been copied to the target extents or when a withdraw command is received.
The target relationship table further includes a bitmap that identifies which tracks involved in the FlashCopy relationship have not yet been copied over and are thus protected tracks. Each track in the target device is represented by one bit in the bitmap. The target bit is set when the corresponding track is established as a target track of a FlashCopy relationship. The target bit is reset when the corresponding track has been copied from the source location and destaged to the target device due to writes on the source or the target device, or a background copy task.
In the prior art, as part of the establishment of the logical point-in-time relationship during the FlashCopy® operation, all tracks in the source cache that are included in the FlashCopy® must be destaged to the physical source volume, e.g., source DASD, and all tracks in the target cache included in the FlashCopy® must be discarded. Further details of the FlashCopy® operations are described in the copending and commonly assigned U.S. patent application Ser. No. 09/347,344, filed on Jul. 2, 1999, entitled “Method, System, and Program for Maintaining Electronic Data as of a Point-in-Time”, which patent application is incorporated herein by reference in its entirety.
Once the logical relationship is established, hosts may then have immediate access to data on the source and target volumes, and the data may be copied as part of a background operation. A read to a track that is a target in a FlashCopy relationship and not in cache triggers a stage intercept, which causes the source track corresponding to the requested target track to be staged to the target cache when the source track has not yet been copied over and before access is provided to the track from the target cache. This ensures that the target has the copy from the source that existed at the point-in-time of the FlashCopy® operation. Further, any writes to tracks on the source device that have not been copied over triggers a destage intercept, which causes the tracks on the source device to be copied to the target device.